<!DOCTYPE html>
<html lang="zh-CN">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Document</title>
</head>
<body>
   <div id="app">
       <input type="button" value="点击事件" v-on:click="f()">
       <input type="button" value="鼠标移动事件" v-on:mouseenter="f2()">
       <input type="button" value="双击事件" v-on:dblclick="f2()">
       <input type="button" value="点击事件" @click="f()">
       <h2 @click="changeFood()">{{food}}</h2>
   </div>
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var app = new Vue({
        el:"#app",
        data:{
            food:"炒鸡蛋"
        },
        methods:{
            f(){
                alert("进入IT行业了");
            },
            f2(){
                alert("周姣,你妈妈喊你回家吃饭了")
            },
            changeFood(){
                this.food += "黄瓜炒鸡蛋"
            }
        }
    })
</script>
</body>
</html>